package net.takela.common.utils;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Objects;

/**
 * @author baboy
 * create at 2023/1/22
 */
public class HashMapBuilder<K,V> {
    private HashMap<K,V> data;
    /**
     * 
     */
    public HashMapBuilder(){
        data = new HashMap<K,V>();
    }
    /**
     * 
     */
    public HashMapBuilder put(K k, V v){
        if (Objects.isNull(k) || Objects.isNull(v)){
            return this;
        }
        data.put(k, v);
        return this;
    }
    public HashMap<K, V> build(){
        return data;
    }


    public static<K, V> HashMapBuilder custom(Type K, Type V){
        return new HashMapBuilder<K, V>();
    }
}
